package com.itheima.stock.config;

import com.google.common.util.concurrent.RateLimiter;
import com.itheima.stock.properties.LimiterProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author CaiZhiMin
 * @created 2025/10/19 16:05
 * @description: id 生成器
 */
@Configuration
public class RateLimiterConfiguration {
    @Bean
    public RateLimiter reteLimiter(LimiterProperties properties) {
        return RateLimiter.create(properties.getConcurrentNum());
    }
}
